#include <stdio.h>
#include <stdarg.h>
#include "fd_log.h"
#include "zf_stm_systick.h"


void log_print(const char *file, int line, const char* fmt, ...)
{
    va_list ap;
    char buf[LOG_BUF_SIZE] = {0};
    long long time = systick_getval_ms(STM0);

    va_start(ap, fmt);
    vsnprintf(buf, sizeof(buf), fmt, ap);
    va_end(ap);

    printf("<%lld ms>[%s:%d] %s ", time, file, line, buf);
}